﻿@* Ui层项目 - 列表页查询条件文件 *@
@using Util.Generators.Helpers
@model Util.Generators.Contexts.EntityContext
@{
    var service = new GenerateService( Model );
    Model.Output.FileNameNoExtension = service.GetClientListPartFileName();
    Model.Output.Extension = ".cshtml";
    Model.Output.RelativeRootPath = $"src/{service.GetClientComponentPath()}/part";
}
@("@")model @service.GetQuery()

<util-card bordered="false" class="searchForm">
    <util-search-form label-width="120">
        <util-row gutter="24">
        @foreach (var property in Model.Properties)
        {
            if (property.IsKey)
                continue;
            if (property.IsDeleted)
                continue;
            if (property.IsExtraProperties)
                continue;
            if (property.IsVersion)
                continue;
            if (property.IsSortId)
                continue;
            if( property.IsCreatorId )
                continue;
            if( property.IsLastModifierId )
                continue;
            if (property.IsPinYin)
                continue;
            if (property.IsTree)
                continue;
            if ( property.IsGuid )
                continue;
            if (property.IsDateTime)
            {
            <util-column>
                <util-range-picker for-begin="Begin@(property.Name)" for-end="End@(property.Name)" />
            </util-column>
                continue;
            }
            if (property.IsBool)
            {
            <util-column>
                <util-select for="@property.Name"/>
            </util-column>
                continue;
            }
            <util-column>
                <util-input for="@property.Name" />
            </util-column>
        }
            <util-column class="mb-md">
                <util-flex justify="FlexEnd" align="Center" gap="Small">
                    <util-button id="btnRefresh" icon="Sync" on-click="refresh(btnRefresh)" text-reset="true" />
                    <util-button id="btnQuery" type="Primary" icon="Search" on-click="query(btnQuery)" text-query="true" />
                    <util-a is-search="true" class="ml-sm" />
                </util-flex>
            </util-column>
        </util-row>
    </util-search-form>
</util-card>